<div class="jqx_group">
<!--    <div><h3 class="pl0 pr0 pt0 pb0 ml0 mr0 mt0 mb0">Information</h3></div>-->
    <div>
        <input type="hidden" id="txt-id" value="{{$configs["obj"]["id"]}}"/>
        <table style="width: 100%;pading:0;margin:0;">
            <tr>
                <td style="width: 100px">Name</td>
                <td style='padding-right:12px'>
                    <input type="text" id="txt-name" class="text-input " style="width: 100%" 
                            value="{{$configs["obj"]["name"]}}"/>
                </td>
            </tr>
            <tr>
                <td >Keyword</td>
                <td style='padding-right:12px'>
                    <input type="text" id="txt-keyword" class="text-input" style="width: 100%"
                            value="{{$configs["obj"]["keyword"]}}"/>
                </td>
            </tr>
            <tr>
                <td >Value</td>
                <td style='padding-right:12px'>
                    <input type="text" id="txt-value" class="text-input" style="width: 100%"
                            value="{{$configs["obj"]["value"]}}"/>
                </td>
            </tr>
            <tr>
                <td>Note</td>
                <td style='padding-right:10px'>
                    <div>
                        <textarea id="txt-note" style="padding:4px;margin:0;width: 100%">{{$configs["obj"]["note"]}}</textarea>
                    </div>
                </td>
            </tr>
            {{if isset($configs["obj"]["insert"])}}
            <tr>
                <td>Insert</td>
                <td>
                    {{$configs["obj"]["insert"]}}
                </td>
            </tr>
            {{/if}}
            {{if isset($configs["obj"]["update"])}}
            <tr>
                <td>Update</td>
                <td>
                    {{$configs["obj"]["update"]}}
                </td>
            </tr>
            {{/if}}

        </table>
    </div>
</div>
<div class="tac">
    <input type="button" value="Save" class="showWindowButton id-save-btn" />
    <input type="button" value="Cancel" class="showWindowButton id-cancel-btn" />
</div>
<script type="text/javascript">
        var AuthorityEditFRM = (function () {
            function _addEvents(){
                $("#txt-name").focus();
                $(".id-save-btn").click(function(){
                    {{if isset($configs["obj"]["lock"])}}
                        $('#window-notice').jqxWindow('setContent', 
                        "This item have been lock.<br/>Please don't change this item.");
                        $('#window-notice').jqxWindow('open');
                    {{elseif isset($configs["obj"]["delete"])}}
                        $('#window-notice').jqxWindow('setContent', 
                        "This item have been deleted.<br/>Please restore item before edit.");
                        $('#window-notice').jqxWindow('open');
                    {{else}}
                        save_authority();
                    {{/if}}
                });
                $(".id-cancel-btn").click(function(){
                     $('#window').jqxWindow('close');
                });
            };
            //Adding event listeners
            function _createElements() {
                var theme=AuthorityEditFRM.config.theme;
                
                //$(".jqx_group").jqxExpander({ showArrow: false, toggleMode: 'none', theme: AuthorityEditFRM.config.theme });//jqxExpander({ width: '100%', theme: AuthorityEditFRM.config.theme, showArrow: false, toggleMode: 'none' });
                $('.showWindowButton').jqxButton({ theme: theme, height: '25px', width: '100px' });
                
            };
            //Creating the demo window
            return {
                config: {
                    dragArea: null,
                    theme: 'classic'
                },
                init: function () {
                    //Creating all jqxWindgets except the window
                    _createElements();
                    //Add events
                    _addEvents();
                }
            };
        } ());
        $(document).ready(function () {
            AuthorityEditFRM.init();            
        });
</script>